var util = require('util');
var https = require('https');
var qs = require('querystring');

app.get('/', function(request, response) {
	var fbCookie = qs.parse(request.cookies['fbs_' + facebook.appId]);
	model.Event.find({ when : { $gt: Date.now() } }).sort('when', 1).run(function(e, events) {
		response.render('home.jade', {
			title : 'Home',
			events : events,
			cookie : fbCookie,
			pretty : true
		});
	});
});
